<template>
  <div>
    <a-button
      v-permission="permission.edit"
      :disabled="disabledEdit"
      type="primary"
      icon="edit"
      @click="crudUpdate(data)"
    />
    <a-popconfirm title="确定删除吗?" @confirm="() => deleteDefine()" okText="删除" cancelText="取消">
      <a-button :disabled="disabledDle" type="danger" icon="delete" />
    </a-popconfirm>
  </div>
</template>
<script>
export default {
  props: {
    data: {
      type: Object,
      required: true,
    },
    permission: {
      type: Object,
      required: true,
    },
    disabledEdit: {
      type: Boolean,
      default: false,
    },
    disabledDle: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
    };
  },
  methods: {
    // 改
    crudUpdate(data){
      this.$emit("crudUpdate",data)
    },
    // 删  确定
    deleteDefine(){
      this.$emit("crudDelete")
    },
  },
};
</script>
